package com.imooc.bigdata.drpc;

import org.apache.hadoop.hdfs.DFSClient;
import org.apache.storm.Config;
import org.apache.storm.utils.DRPCClient;

/**
 * Remote DRPC客户端测试类
 * Created by zghgchao 2018/2/3 14:39
 */
public class RemoveDRPCClient {
    public static void main(String[] args) throws Exception {
        Config config = new Config();

        config.put("storm.thrift.transport", "org.apache.storm.security.auth.SimpleTransportPlugin");
        config.put(Config.STORM_NIMBUS_RETRY_TIMES, 3);
        config.put(Config.STORM_NIMBUS_RETRY_INTERVAL, 10);
        config.put(Config.STORM_NIMBUS_RETRY_INTERVAL_CEILING, 20);
        config.put(Config.DRPC_MAX_BUFFER_SIZE, 1048576);

        DRPCClient drpcClient = new DRPCClient(config, "hadoop000", 3772);
        String result = drpcClient.execute("addUser", "lisi");

        System.out.println("Client invoked: " + result);
    }
}
